import request from '@/utils/request'

// 查询业务类别管理列表
export function listCategory(query) {
  return request({
    url: '/system/businessCategory/list',
    method: 'get',
    params: query
  })
}

// 查询业务类别管理详细
export function getCategory(id) {
  return request({
    url: '/system/businessCategory/' + id,
    method: 'get'
  })
}

export function getCategoryByGuid(guid) {
  return request({
    url: '/system/businessCategory/getInfoByGuid/' + guid,
    method: 'get'
  })
}

// 新增业务类别管理
export function addCategory(data) {
  return request({
    url: '/system/businessCategory',
    method: 'post',
    data: data
  })
}

// 修改业务类别管理
export function updateCategory(data) {
  return request({
    url: '/system/businessCategory',
    method: 'put',
    data: data
  })
}

// 删除业务类别管理
export function delCategory(id) {
  return request({
    url: '/system/businessCategory/' + id,
    method: 'delete'
  })
}

// 导出业务类别管理
export function exportCategory(query) {
  return request({
    url: '/system/businessCategory/export',
    method: 'get',
    params: query
  })
}

// 查询业务类别下拉树结构
export function treeselect() {
  return request({
    url: '/system/businessCategory/treeselect',
    method: 'get'
  })
}

export function getFunOptions(){
  return request({
    url: '/system/businessCategory/getFunOptions',
    method: 'get'
  })
}

// 查询业务类别管理详细
export function checkAgency(businessTypeId) {
  return request({
    url: '/system/businessCategory/checkAgency/' + businessTypeId,
    method: 'get'
  })
}